home *** CD-ROM | disk | FTP | other *** search
- ****************************************************
- * DISCLAIMER: we (Lunkwill & Skywalker) take no *
- * responsibility for damages on your brain, Amiga, *
- * mother-in-law or whatever directly or indirectly *
- * caused by reading, executing, disassembling, *
- * archiving or deleting this sourcecode or *
- * executable. This code was done entirely under *
- * heavy influence of THC - you have been warned! *
- ****************************************************
-
-
- OpenLibrary = -552
- CloseLibrary = -414
- Forbid = -132
- Permit = -138
- SetFunction = -420
- Wait = -318
-
- GetVar = -906
- Output = -60
- Write = -48
- ReadArgs = -798
- FreeArgs = -858
-
- OpenScreen = -198
- OpenScreenTagList = -612
- OpenWindow = -204
- OpenWindowTagList = -606
-
- SIGBREAKF_CTRL_C = (1<<12)
- GVF_LOCAL_ONLY = $200
-
- move.l 4,a6
- lea IntuiName(pc),a1
- moveq #37,d0
- jsr OpenLibrary(a6)
- move.l d0,IntuiBase
- beq.w NoIntui ;poooooor amiga! no intuition :-(
-
- lea DosName(pc),a1
- moveq #36,d0
- jsr OpenLibrary(a6)
- move.l d0,a6
- beq.w NoDos ;no dos either? is it NT?
- move.l d0,DosBase
-
- lea ArgTemplate(pc),a0
- move.l a0,d1
- lea ArgPtr(pc),a0
- move.l a0,d2
- moveq #0,d3
- jsr ReadArgs(a6)
- move.l d0,ArgStruct
- beq.w WrongArgs ;shtupid bugga! enta sum variable!
-
- move.l 4,a6
- jsr Forbid(a6) ;stop it! it's me, patching. only me!!!
-
- move.l IntuiBase(pc),a1
- suba.l a0,a0
- move.w #OpenScreen,a0
- lea NewOpenScreen(pc),a2
- move.l a2,d0
- jsr SetFunction(a6) ;one patch fo' momma
- move.l d0,OldOpenScreen
-
- move.l IntuiBase(pc),a1
- suba.l a0,a0
- move.w #OpenScreenTagList,a0
- lea NewOpenScreenTagList(pc),a2
- move.l a2,d0
- jsr SetFunction(a6) ;one fo' daddy
- move.l d0,OldOpenScreenTagList
-
- move.l IntuiBase(pc),a1
- suba.l a0,a0
- move.w #OpenWindow,a0
- lea NewOpenWindow(pc),a2
- move.l a2,d0
- jsr SetFunction(a6) ;one fo' littl sis
- move.l d0,OldOpenWindow
-
- move.l IntuiBase(pc),a1
- suba.l a0,a0
- move.w #OpenWindowTagList,a0
- lea NewOpenWindowTagList(pc),a2
- move.l a2,d0
- jsr SetFunction(a6) ;and...c'mon...one fo' ya amiga!
- move.l d0,OldOpenWindowTagList
-
- jsr Permit(a6) ;go on there...
-
- bsr.w PrintC ;sum babble to da shell
- jsr Output(a6)
- move.l d0,d1
- lea Installed_Msg(pc),a0 ;more babble
- move.l a0,d2
- moveq #Installed_Len,d3
- jsr Write(a6)
-
- move.l 4,a6
- move.l #SIGBREAKF_CTRL_C,d0 ;why r-we-wai-tin'?
- jsr Wait(a6) ;we r suffo-ca-tin'!
- ;Ctrl-C received ;sucka wanna quit :-(
- move.l IntuiBase(pc),a1
- suba.l a0,a0
- move.w #OpenScreenTagList,a0
- move.l OldOpenScreenTagList(pc),d0
- jsr SetFunction(a6) ;if you
-
- move.l IntuiBase(pc),a1
- suba.l a0,a0
- move.w #OpenScreen,a0
- move.l OldOpenScreen(pc),d0
- jsr SetFunction(a6) ;really wanna
-
- move.l IntuiBase(pc),a1
- suba.l a0,a0
- move.w #OpenWindowTagList,a0
- move.l OldOpenWindowTagList(pc),d0
- jsr SetFunction(a6) ;quit...
-
- move.l IntuiBase(pc),a1
- suba.l a0,a0
- move.w #OpenWindow,a0
- move.l OldOpenWindow(pc),d0
- jsr SetFunction(a6) ;ok then!
-
- bsr.w PrintC ;neverendin' babble
- jsr Output(a6)
- move.l d0,d1
- lea Removed_Msg(pc),a0 ;will it neva end?
- move.l a0,d2
- moveq #Removed_Len,d3
- pea CleanUp(pc)
- jmp Write(a6)
-
- WrongArgs:
- jsr Output(a6) ;i knew it!
- move.l d0,d1
- lea WrongArgs_Msg(pc),a0
- move.l a0,d2
- move.l #WrongArgs_Len,d3
- jsr Write(a6) ;there's...there's more...teeexxxt!!!
-
- CleanUp:
- move.l DosBase(pc),a6
- move.l ArgStruct(pc),d1
- jsr FreeArgs(a6) ;piss off args!
-
- move.l a6,a1
- move.l 4,a6
- jsr CloseLibrary(a6) ;and dos
- NoDos:
- move.l IntuiBase(pc),a1
- jsr CloseLibrary(a6) ;and intuition
- NoIntui:
- moveq #0,d0
- rts ;cya!
-
-
- NewOpenScreen:
- movem.l d0-d4/a0-a1/a6,-(sp)
- jsr CheckVar ;we have a variable here?
- bne.s OpenScreen_OK ;no -> go on open it!
- movem.l (sp)+,d0-d4/a0-a1/a6
- moveq #0,d0 ;else quit
- rts ;returning FALSE
- OpenScreen_OK:
- movem.l (sp)+,d0-d4/a0-a1/a6
- move.l OldOpenScreen(pc),-(sp)
- rts
-
- NewOpenScreenTaglist:
- movem.l d0-d4/a0-a1/a6,-(sp)
- jsr CheckVar
- bne.s OpenScreenTaglist_OK
- movem.l (sp)+,d0-d4/a0-a1/a6
- moveq #0,d0
- rts
- OpenScreenTaglist_OK:
- movem.l (sp)+,d0-d4/a0-a1/a6
- move.l OldOpenScreenTaglist(pc),-(sp)
- rts
-
- NewOpenWindow:
- movem.l d0-d4/a0-a1/a6,-(sp)
- jsr CheckVar
- bne.s OpenWindow_OK
- movem.l (sp)+,d0-d4/a0-a1/a6
- moveq #0,d0
- rts
- OpenWindow_OK:
- movem.l (sp)+,d0-d4/a0-a1/a6
- move.l OldOpenWindow(pc),-(sp)
- rts
-
- NewOpenWindowTaglist:
- movem.l d0-d4/a0-a1/a6,-(sp)
- jsr CheckVar
- bne.s OpenWindowTaglist_OK
- movem.l (sp)+,d0-d4/a0-a1/a6
- moveq #0,d0
- rts
- OpenWindowTaglist_OK:
- movem.l (sp)+,d0-d4/a0-a1/a6
- move.l OldOpenWindowTaglist(pc),-(sp)
- rts
-
- CheckVar:
- move.l DosBase(pc),a6 ;illegal tricks in here :-(
- move.l ArgPtr(pc),a0
- move.l a0,d1
- lea VarBuf(pc),a0
- move.l a0,d2
- moveq #1,d3
- move.l #GVF_LOCAL_ONLY,d4 ;only want var for our process
- jsr GetVar(a6) ;we shouldn't do that inside an
- cmpi.l #-1,d0 ;intuition fuction...
- bne.s CV_IOSer ;got var? -> I/O is ASCII only
- moveq #1,d0
- rts
- CV_IOSer:
- move.l DosBase(pc),a6
- jsr Output(a6) ;blah...error...no window
- move.l d0,d1
- lea ErrorNoDisplay_Msg(pc),a0
- move.l a0,d2
- move.l #ErrorNoDisplay_Len,d3
- jsr Write(a6) ;hey, usa!
- moveq #0,d0
- rts
-
- PrintC:
- move.l DosBase(pc),a6 ;side fx? waddsat?
- jsr Output(a6)
- move.l d0,d1
- lea Copyright_Msg(pc),a0
- move.l a0,d2
- move.l #Copyright_Len,d3
- jsr Write(a6)
- rts
-
- OldOpenscreen: dc.l 0
- OldOpenscreentaglist: dc.l 0
- OldOpenwindow: dc.l 0
- OldOpenwindowtaglist: dc.l 0
- IntuiBase: dc.l 0
- DosBase: dc.l 0
- ArgPtr: dc.l 0
- ArgStruct: dc.l 0
- VarBuf: dc.w 0
- ArgTemplate: dc.b "Variable/A",0
- IntuiName: dc.b "intuition.library",0
- DosName: dc.b "dos.library",0
- WrongArgs_Msg: dc.b "Usage: rshell-protector <variable-name>",$a
- WrongArgs_Len: EQU *-WrongArgs_Msg
- ErrorNoDisplay_Msg: dc.b $7,"You are using an ASCII-only terminal.",$a
- dc.b "Could not open intuition GUI!",$a
- ErrorNoDisplay_Len: EQU *-ErrorNoDisplay_Msg
- Copyright_Msg: dc.b $1b,"[32mRemoteShell-Protector V37.3",$a
- dc.b "(L) 1994 by Lunkwill & Skywalker",$a
- dc.b $1b,"[0mPatches "
- Copyright_Len: EQU *-Copyright_Msg
- Installed_Msg: dc.b "installed!",$a
- Installed_Len: EQU *-Installed_Msg
- Removed_Msg: dc.b "removed!",$a
- Removed_Len: EQU *-Removed_Msg
-
- ;hehe, and still under 1K !!!
-